package listeners;

public class Demo {
	public static int totalCookies = 0;
	
	public static void main(String[] args) {
		Cook cook = new Cook();
		CookListener cookListener = new CookListener() {
			@Override
			public void cookiesBaked(CookieEvent cookieEvent) {
				
				System.out.println("Cook just baked " + cookieEvent.getAmount() + " cookies at " + cookieEvent.getDate().toString());
				
				Demo.totalCookies = Demo.totalCookies + cookieEvent.getAmount();
				
				System.out.println("Total cookies baked: " + Demo.totalCookies);
			}
		};

		cook.addCookListener(cookListener);
		cook.run();
	}
}
